<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" href="css/index.css">
		<link rel="stylesheet" href="css/reset.css">
		<title></title>
	</head>
	<body>
					<!-- 容器 -->
				<div class="my_root">
					<!-- 头部 背景-->
					<div class="my_header">
						<div class="my_header_center">
							<!-- logo -->
								<div class="my_logo">
									<a href="index.html">
										<img src="images/my_logo.png" alt="">
									</a>
								</div>
							<!-- 导航 -->
								<ul class="ul_nav">
									<li><a href="javascript:;">手机版</a></li>
									<li><a href="javascript:;">我要开店</a></li>
									<li><a href="Sign.html">登录</a></li>
									<li><a href="register.html">注册</a></li>
									<li><a href="javascript:;">商务合作</a></li>
									<li><a href="javascript:;">我的订单</a></li>
								</ul>
						</div>
					</div>
					<!-- 第二部分 -->
					<div class="my_ipt">
						<div class="my_ipt_left">
								<i class="magnifier"></i>
								<form action="">
									<input type="text" placeholder="商品,品类,类别,国家" class="inpt">
								</form>
							</div>
						
						<div class="my_ipt_right">
							<a href="javascript:;">
								<i></i>
								<span>分类</span>
							</a>
						</div>
					</div>
					<!-- 第三部分 -->
					<div class="three">
						<div class="three_center">
							<div class="Cooperate">合作品牌</div>
							<div class="Advert">
								<ul>
									<li>
										<a href="javascript:;">
											<img src="images/wyeth.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/friso.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/illuma.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/moony.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/pouch.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/britax.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/logo_1.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/pigeon.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/huggies.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/huawang.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/medela.jpg" alt="">
										</a>
									</li>
									<li>
										<a href="javascript:;">
											<img src="images/nemans.jpg" alt="">
										</a>
									</li>
								</ul>
								<p class="txt">十五年来合作近千个品牌</p>
								<a href="javascript:;" class="more">更多品牌</a>
								<a href="javascript:;" class="downline">
									线下店
									<i></i>
								</a>
							</div>
						</div>
					</div>
					<!-- 第四部分 -->
					<div class="four">
						<div class="lunbo_center">
								<div class="title">品牌推荐</div>
								<div class="lunbo_z">
									<ul class="item" id="lunBo">
										<li class="Solve">
											<a href="javascript:;">
												<img src="" alt="" class="banner_img">
											</a>
										</li>
										<li class="Solve">
											<a href="javascript:;">
												<img src="" alt="" class="banner_img">
											</a>
										</li>
										<li class="Solve">
											<a href="javascript:;">
												<img src="" alt="" class="banner_img">
											</a>
										</li>
									</ul>
									<ul class="page"><li class="active"></li><li></li></ul>
								</div>
						</div>
						<div class="onclick_p">
							<div class="on_p">
								<div class="one_p width_p">
									<a href="javascript:;">
										<img src="images/tm0118.jpg" alt="">
										<p>汤美奶瓶全场低至4折</p>
										<span>汤美奶瓶全场低至4折</span>
									</a>
								</div>
								<div class="one_p width_p">
									<a href="javascript:;">
										<img src="images/b1182.jpg" alt="">
										<p>布朗博士爱宝选奶瓶专场</p>
										<span>一种美式的生活态度</span>
									</a>
								</div>
								<div class="one_p width_r">
									<a href="javascript:;">
										<img src="images/bbd.jpg" alt="">
										<p>巴布豆保暖羽绒特价 150元</p>
										<span>巴布豆保暖羽绒 反季特价 150元</span>
									</a>
								</div>
								<button class="button_1 posi"></button>
								<button class="button_2 posi"></button>
							</div>
						</div>
					</div>
					<!-- 第五部分 -->
					<div class="five">
						<div class="five_center">
							<div class="title">单品推荐</div>
							<div class="on_pic" id="lunBo_div">
								<!-- <div class="tow_p width_l">
									<a href="javascript:;">
										<img src="images/152799.jpg" alt="">
										<h3>贝亲细轴棉花棒（400支）</h3>
										<p>贝亲从婴儿到成人，温柔的呵护肌肤。100%脱脂纯棉，纸轴超细棉棒，不易折断，韧性强。</p>
									</a>
								</div>
								<div class="tow_p width_l">
									<a href="javascript:;">
										<img src="images/20160219100746_44_77071.jpg" alt="">
										<h3>贝亲产褥期卫生巾L（18*60cm）6片/包</h3>
										<p>贝亲孕产妇卫生巾采用透气底膜，吸收后能迅速透出湿气和热气。</p>
									</a>
								</div>
								<div class="tow_p width_l">
									<a href="javascript:;">
										<img src="images/20160714113826_31_155726.jpg" alt="">
										<h3>迪士尼宝宝小画家舒棉绒分腿睡袋80蓝色</h3>
										<p>细腻亲肤  贴心呵护</p>
									</a>
								</div>
								<div class="tow_p">
									<a href="javascript:;">
										<img src="images/20160122105735_44_116403.jpg" alt="">
										<h3>贝惠谊14低腰纯棉孕妇内裤XXL(68kg以...</h3>
										<p>透气性好，健康纯棉</p>
									</a>
								</div> -->
								<!-- <button class="button_1 posit"></button>
								<button class="button_2 posit"></button> -->
							</div>
						</div>
						<div class="Special">
							<a href="javascript:;">特卖专场</a>
						</div>
					</div>
					<!-- 第六部分 -->
					<div class="six">
						<div class="six_center">
							<div class="six_p">
								<p>购物：<a href="javascript:;">妈妈专区</a>/<a href="javascript:;">哺乳喂养</a>/<a href="javascript:;">奶粉辅食</a>/<a href="javascript:;">纸尿裤湿巾</a>/<a href="javascript:;">洗护用品</a>/<a href="javascript:;">宝宝服饰</a>/<a href="javascript:;">童车座椅</a>/<a href="javascript:;">玩具</a>/<a href="javascript:;">床椅寝具</a>/<a href="javascript:;">收纳外出</a>/<a href="javascript:;">特卖专区</a>/<a href="javascript:;">海淘</a>/<a href="javascript:;">手机网站</a></p>
								<p>商务合作：<a href="javascript:;">实体开店</a>/<a href="javascript:;">供应商入驻</a>/<a href="javascript:;">特卖入驻</a>/</p>
								<p>由本网站发布的商品或服务的商业宣传活动均属“广告”</p>
							</div>
							<div class="six_li">
								<dl>
									<dt>购物指南</dt>
									<dd><a href="javascript:;">购物流程</a></dd>
									<dd><a href="javascript:;">常见问题</a></dd>
									<dd><a href="javascript:;">优惠码(券)</a></dd>
									<dd><a href="javascript:;">在线支付</a></dd>
								</dl>
								<dl>
									<dt>配送方式</dt>
									<dd><a href="javascript:;">运费及时效</a></dd>
									<dd><a href="javascript:;">品牌专场配送方式</a></dd>
									<dd><a href="javascript:;">海淘配送方式</a></dd>
								</dl>
								<dl>
									<dt>售后服务</dt>
									<dd><a href="javascript:;">退换货原则</a></dd>
									<dd><a href="javascript:;">退换货流程</a></dd>
									<dd><a href="javascript:;">退换货周期</a></dd>
									<dd><a href="javascript:;">品牌专场售后政策</a></dd>
								</dl>
								<dl>
									<dt>品牌授权</dt>
									<dd><a href="javascript:;">扶持开店</a></dd>
									<dd><a href="javascript:;">下载专区</a></dd>
									<dd><a href="javascript:;">门店分布</a></dd>
								</dl>
								<dl>
									<dt>关于我们</dt>
									<dd><a href="javascript:;">企业理念</a></dd>
									<dd><a href="javascript:;">网站合作</a></dd>
									<dd><a href="javascript:;">人才招聘</a></dd>
									<dd><a href="javascript:;">关于我们</a></dd>
								</dl>
								<div class="weixin">
									<div class="weixin_img">
										<img src="images/weixin_code.jpg" alt="">
									</div>
									<div class="weixin_p">
										<i class="weixin_icon">
											<img src="images/weixin_icon.jpg" alt="">
										</i>
										<span>扫一扫加微信</span>
									</div>
								</div>
							</div>
							<div class="footer">
								<ul class="footer_ul">
									<li><a href="javascript:;">首页</a></li>
									|
									<li><a href="javascript:;">公司简介</a></li>
									|
									<li><a href="javascript:;">人才招聘</a></li>
									|
									<li><a href="javascript:;">合作联系</a></li>
									|
									<li><a href="javascript:;">企业理念</a></li>
									|
									<li><a href="javascript:;">隐私条款</a></li>
								</ul>
								<div class="foot_p">
									<span>由本网站发布的商品或服务的商业宣传活动均属“广告”</br></span>
									<span>Copyright©2003 - 2017 上海母婴之家网络科技股份有限公司 muyingzhijia.com All Rights Reserved 客服热线：021-51760000 4008201000 </br></span>
									<span>出版物经营许可证新出发(沪)零字第E6980号</span>
								</div>
								<div class="foot_last">
									<a href="javascript:;">
										<img src="images/shanghai_industry.gif" alt="">
									</a>
									<a href="javascript:;">
										<img src="images/brand_bottom_large.jpg" alt="">
									</a>
								</div>
								<div class="foot_end">
									<a href="javascript:;"><span>沪ICP备09021709号</span></a>
									<a href="javascript:;"><img src="images/ghs.png" alt=""><span>沪公网安备 31010402000751号</span></a>
								</div>
							</div>
						</div>
					</div>
					<!-- 第七部分 -->
					<div class="fix_div">
						<!-- 用户头像 -->
						<div class="name_top">
							<a href="javascript:;" class="name_top_a">
								<s></s>
							</a>
							<!-- hover出的页面 -->
							<div class="name_fix">
								<div class="name_img">
									<img src="images/userimg.jpg" alt="">
									<span class="cloes_name"></span>
								</div>
								<div class="name_p">
									<span>您好，母婴之家用户，请</span>
									<a href="Sign.html">登录</a>
									&nbsp | &nbsp
									<a href="register.html">注册</a>
								</div>
							</div>
						</div>
						
						<!-- 购物车 -->
						<div class="shopp_car">
							<div class="border_top"></div>
							<div class="shopp_car_1">
								<a href="javascript:;">
									<s></s>
									<span>购物车</span>
								</a>
							</div>
						</div>
						<div class="share">
							<a href="javascript:;">
								<s></s>
							</a>
						</div>
						<!-- 收藏 -->
						<div class="Collection">
							<a href="javascript:;" class="Collection_a">
								<s></s>
							</a>
							<!-- hover出的页面 -->
							<div class="name_fix_1">
								<div class="name_img">
									<img src="images/userimg.jpg" alt="">
									<span class="cloes_name"></span>
								</div>
								<div class="name_p">
									<span>您好，母婴之家用户，请</span>
									<a href="Sign.html">登录</a>
									&nbsp | &nbsp
									<a href="register.html">注册</a>
								</div>
							</div>
						</div>
						
						<!-- 客服 -->
						<div class="help">
							<a href="javascript:;" class="help_a">
								<s></s>
								<span>在线客服</span>
							</a>
							<div class="ba_top_1" >
								<a href="#">客服</a>
							</div>
						</div>
						
						<!-- 返回顶层 -->
						<div class="back_top">
							<a href="#" class="back_top_a">
								<s></s>
							</a>
							<div class="ba_top">
								<a href="#">返回顶部</a>
							</div>
						</div>
						
					</div>
				</div>
				
				<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
				<script src="js/index.js"></script>
				<script src="js/cookie.js"></script>
				
				
				<script>
					var uid = getCookie("token");
					console.log(uid)
					var url = "http://jx.xuzhixiang.top/ap/api/productlist.php";
					$.ajax({
						url:url,
						type:"get",
						data:{uid},
						success:function(res){
							var obj = JSON.parse(res);
							var html = "";
							var html1 = "";
							var html2 = "";
							var html3 = "";
							var html4 = "";
							for(var i=0;i<obj.data.length;i++){
								html +=`
									<div class="tow_p width_l">
										<a href="javascript:;">
											<img src="${obj.data[i].pimg}" alt="">
											<h3>${obj.data[i].pdesc}</h3>
											<p>${obj.data[i].pname}</p>
										</a>
									</div>
								`
							}
							html1 +=`
								<button class="button_1 posit" id="btn_left"></button>
								<button class="button_2 posit_1" id="btn_right"></button>
							` 
							$(".on_pic").html(html);
							$(".five_center").append(html1);
							$(".tow_p").on("click",function(){
								num = $(this).index()
								$.ajax({
									url:"http://jx.xuzhixiang.top/ap/api/productlist.php",
									type:"get",
									data:{uid},
									success:function(res){
										var obj = JSON.parse(res);
										var pid = obj.data[num].pid;
										location.href = "Commodity.html?pid="+pid
									}
								})
							})
							$("#btn_right").on("click",function(){
								selectDiv(index);
							})
						}
					})
					
					
					var banner_img = $(".banner_img").attr("src")
					//轮播图
					function lunbo(){
						var url = "http://jx.xuzhixiang.top/ap/api/bannerlist.php";
						$.ajax({
							url:url,
							type:"get",
							data:{uid},
							success:function(res){
								var obj = JSON.parse(res);
								for(var i=0;i<obj.data.length;i++){
									$(".banner_img").eq(i).attr("src",obj.data[i].banner_img_url)
								}
							}
						})
					}
					lunbo();
					
					//计数
					var index= 0;
					//获取第一个div的宽度
					<!-- var divWidth = $(".on_pic").eq(0).width(); -->
					//轮播图主程序
					function selectDiv(num) {
						$("#lunBo_div").animate({
							left: -num * 1090,
						},800, function() {
							//检查是否到最后一张
							if (index == $(".lunBo_div").length/4){
								index == 0;
								$(".on_pic").css("left", "0px");
							}
						})
					}
				</script>
</body>
</html>
